<?php
switch($action){
    case 'get_data':
        exit();
        break;
    default:
        include './module/include/right.inc.php';
        $curr_page = $page > 0 ? intval($page) : 1;
        $page_size = 15;
        
        $start_nums = ($curr_page - 1) * $page_size;
        $sql = "SELECT *,FROM_UNIXTIME(add_time,'%Y') as design_year,FROM_UNIXTIME(add_time,'%m') as design_month FROM design_design WHERE on_sale = 'Y' ".($cat_id > 0 ? "AND cat_id='{$cat_id}'" : '')." ORDER BY design_id DESC LIMIT {$start_nums},{$page_size}";
        $data = $db->fetch_all($sql);
        //for page
        $total_nums = $db->result_first(get_count_sql($sql));
        $total_page = ceil($total_nums/$page_size);
        $page_param = '';

        $curr_time = time();
        $new_time = 7*24*3600;
        break;
}
?>